SET(PROJ_NAME stream_service)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)

# find_path(BASICUSAGEENVIRONMENT_INCLUDE_DIR BasicUsageEnvironment.hh HINTS ${CMAKE_SYSROOT}/usr/include/BasicUsageEnvironment)
# find_path(GROUPSOCK_INCLUDE_DIR Groupsock.hh HINTS ${CMAKE_SYSROOT}/usr/include/groupsock)
# find_path(LIVEMEDIA_INCLUDE_DIR liveMedia.hh HINTS ${CMAKE_SYSROOT}/usr/include/liveMedia)
# find_path(USAGEENVIRONMENT_INCLUDE_DIR UsageEnvironment.hh HINTS ${CMAKE_SYSROOT}/usr/include/UsageEnvironment)
# include_directories(${BASICUSAGEENVIRONMENT_INCLUDE_DIR})
# include_directories(${GROUPSOCK_INCLUDE_DIR})
# include_directories(${LIVEMEDIA_INCLUDE_DIR})
# include_directories(${USAGEENVIRONMENT_INCLUDE_DIR})

# 初始化 ALL_SOURCES 变量
set(ALL_SOURCES "")

list(APPEND ALL_SOURCES "src/stream_service.cpp")
list(APPEND ALL_SOURCES "src/stream_flow_control.cpp")

# file(GLOB_RECURSE LIVE555_SOURCES 
#     "src/live555/*.cpp" 
#     "src/live555/*.hpp" 
#     "src/live555/*.c" 
#     "src/live555/*.h"
# )
# list(APPEND ALL_SOURCES ${LIVE555_SOURCES})

file(GLOB_RECURSE GSTREAMER_SOURCES 
    "src/gstreamer/*.cpp" "src/gstreamer/*.hpp" "src/gstreamer/*.c" "src/gstreamer/*.h")
list(APPEND ALL_SOURCES ${GSTREAMER_SOURCES})

add_library(${PROJ_NAME} STATIC ${ALL_SOURCES})

if(BUILD_TESTS)
    add_subdirectory(test)
endif()